<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>公司主页</title>
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/style.css"/>
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/editcompany.css"/>
		 <script type="text/javascript" src="Public/uploadify/jquery-1.8.2.min.js"></script>
		<script src="./Public/Home/js/jquery.easing.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="./Public/Home/js/index.js" type="text/javascript" charset="utf-8"></script>
		<script src="./Public/Home/js/editcompany.js" type="text/javascript" charset="utf-8"></script>
		<!-- 引入uploadify所需插件 -->
		<script type="text/javascript" src="./Public/uploadify/jquery.uploadify.min.js"></script>
    	<link rel="stylesheet" type="text/css" href="./Public/uploadify/uploadify.css">
	</head>
	<body>
	{{include file="../Common/header"}}
	<form action="" method="post">
	<!--企业头部-->
	<div class="top_info">
		<!--展示模式-->
		<div class="top_info_wrap" style="display: block;">
			<img src="{{$data['logo']?$data['logo']:'./Public/Home/image/noresult.png'}}"/>
			<div class="company_info">
				<div class="company_main">
					<a href="javascript:void(0);" class="edit">
						<i></i>编辑
					</a>
					<h1>
						<a href="#" target="_blank" title="{{$data['gsname']}}">{{$data['shortname']}}</a>
					</h1>
					<div class="company_word">
						{{$data['digest']}}
					</div>
				</div>
				<div class="company_data">
					<ul>
						<li>
							<strong>{{$num}}个</strong>
							<br />
							<span title="该公司的在招职位数量">
								<span>招聘职位</span>
								<span class="tip"></span>
							</span>
						</li>
						<li>
							<strong>{{$_SESSION['homeInfo']['lastlogintime']?date('Y-m-d',$_SESSION['homeInfo']['lastlogintime']):'今天'}}</strong>
							<br />
							<span title="该公司职位管理者最近一次登录时间">
								<span>企业最近登录</span>
								<span class="tip"></span>
							</span>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<!--编辑模式-->
		<div class="top_info_edit" style="display: none;">

				<input type="hidden" value="{{$data['gsid']}}" name="gsid">
				<input type="hidden" value="{{$data['gsname']}}" name="gsname">
				<input type="hidden" value="{{$data['license']}}" name="license">
				<div class="company_logo_edit">
					<img src="{{$data['logo']?$data['logo']:'./Public/Home/image/noresult.png'}}"/>
					<div class="upload_shadow"></div>
					<div class="upload_text">
						<i></i>
						<span>上传LOGO请小于10M<br />尺寸：170px*170px</span>
					</div>
					<label >
						<input id="w" type="file" multiple="true">
						<script type="text/javascript">
					        $(function() {
					            $('#w').uploadify({
					                'formData'     : {//POST数据
					                    '<?php echo session_name();?>' : '<?php echo session_id();?>',
					                },
					                'fileTypeExts' : '*.jpg;*.png',
					                'swf'      : '{{__PUBLIC__}}/uploadify/uploadify.swf',
					                'uploader' : '{{U('upload')}}',//指定服务器上传的方法
					                'buttonText':'',
					                'fileSizeLimit' : '2000KB',
					                'uploadLimit' : 1,//上传文件数
					                'width':164,
					                'height':164,
					                'successTimeout':10,//等待服务器响应时间
					                'removeTimeout' : 0.2,//成功显示时间
					                'onUploadSuccess' : function(file, data, response) {
					                    //把php返回的数据转为json
					                    data=$.parseJSON(data);
					                    //获得图片地址
					                    var imageUrl = data.url;
					                    var li="<li>";
					                    li += "<img style='width:164px;height:164px;' src='"+imageUrl+"'/>";
					                    li += "<input type='hidden' name='logo' value='"+data.path+"'/><a href='javascript:;' id='self-close'>X</a>";
					                    li += "</li>";
					                    $("#uploadLi ul").prepend(li);
					                }
					            });

								//关闭图片
					            var i = 1;
					            $('#self-close').live('click',function(){
					                $(this).parent('li').remove();
					                i++;
					                $('#w').uploadify('settings','uploadLimit',i);
					                var oldImg=$(this).siblings('input').val();
					                $.ajax({
					                	type:"post",
					                	url:"{{U('delUpload')}}",
					                	data:{oldImg:oldImg},
					                	success:function(data){

					                	}
					                });
					            })
					        });
					    </script>
					    <div id="uploadLi">
					        <ul>

					        </ul>
					    </div>
					</label>
				</div>
				<div class="company_info_edit">
					<a href="javascript:void(0);" class="cancel_edit">
						<i></i>取消编辑
					</a>
					<label>
						<span class="redstar">*</span>
						<input type="text" name="shortname" id="" value="{{$data['shortname']}}" placeholder="请输入公司简称，如：聘Pin" />
						<span class="red">（公司简称仅能修改1次）</span>
					</label>
					<div class="logoname">{{$data['gsname']}}</div>
					<label>
						<span class="redstar">*</span>
						<input type="text" name="digest" id="" value="{{$data['digest']}}" placeholder="一句话概括公司亮点，如：公司愿景、领导团队等" class="long" />
					</label>
					<input type="submit" value="保存" class="save" />
					<a href="javascript:void(0);" class="cancel">取消</a>
				</div>
		</div>
	</div>
	<!--企业头部结束-->
	<!--公司主页导航条-->
	<div class="company_navs">
		<div class="company_navs_wrap">
			<ul>
				<li class="current"><a href="company.html">公司主页</a></li>
				<li><a href="jobMsg.html">招聘职位({{$num}})</a></li>
			</ul>
		</div>
	</div>
	<!--公司主页导航条结束-->
	<!--主体部分-->
	<div class="main_container">
		<!--左边部分-->
		<div class="container_left">
			<div class="item_container" id="company_intro">
				<div class="item_title">公司介绍</div>
				<span class="item_ropera">
					<em></em>
					<span class="item_ropetext">编辑</span>
				</span>
				<div class="item_content" >
					<div class="company_intro_text">
						<span>{{str_replace(array("\n","\r\n"),"<BR />",$data['introduction'])}}</span>
					</div>
					<div class="company_intro_pic">
						<div id="imgGallery">
							<ul>
								<li>
								{{if value="$data['exhibition']"}}
									<img src="{{$data['exhibition']}}" style="width: 300px;"/>
								{{endif}}
								</li>
							</ul>
						</div>
					</div>
				</div>
				<div class="item_content_edit" style="display: none;">
					<div class="content_edit_tip">对公司详尽又生动的图文介绍，是吸引应聘者的最佳利器。</div>
					<span class="item_ropera_cancel">
						<em></em>
						<span class="item_ropetext">取消编辑</span>
					</span>
					<div class="item_main_edit">

							<label>
								<div class="edui">
									<textarea name="introduction" rows="" cols="">{{$data['introduction']}}</textarea>
								</div>
								<span>最多可输入1000个字</span>
							</label>
							<div class="com_img_wrap">
								<div class="dash_wrap">
									<i></i>
									<span>
										上传公司图片请小于10M <br />
										尺寸：480px*340px
									</span>
					<label>
						<input id="f" type="file" multiple="true">
						<div id="uploadList">
					        <ul>

					        </ul>
					    </div>
					</label>
					<script type="text/javascript">
					    $(function() {
					        $('#f').uploadify({
					            'formData'     : {//POST数据
					                '<?php echo session_name();?>' : '<?php echo session_id();?>',
					            },
					            'fileTypeExts' : '*.jpg;*.png',
					            'swf'      : '{{__PUBLIC__}}/uploadify/uploadify.swf',
					            'uploader' : '{{U('upload')}}',//指定服务器上传的方法
					            'buttonText':'',
					            'fileSizeLimit' : '2000KB',
					            'uploadLimit' : 1,//上传文件数
					            'width':328,
					            'height':232,
					            'successTimeout':10,//等待服务器响应时间
					            'removeTimeout' : 0.2,//成功显示时间
					            'onUploadSuccess' : function(file, data, response) {
					                //把php返回的数据转为json
					                data=$.parseJSON(data);
					                //获得图片地址
					                var imageUrl = data.url;
					                var li="<li>";
					                li += "<img style='width:328px;height:232px;' src='"+imageUrl+"'/>";
					                li += "<input type='hidden' name='exhibition' value='"+data.path+"'/><a href='javascript:;' class='self-close'>X</a>";
					                li += "</li>";
					                $("#uploadList ul").prepend(li);
					            }
					        });

							//关闭图片
					        var i = 1;
					        $('.self-close').live('click',function(){
					            $(this).parent('li').remove();
					            i++;
					            $('#f').uploadify('settings','uploadLimit',i);
					            var oldImg=$(this).siblings('input').val();
					            $.ajax({
					            	type:"post",
					            	url:"{{U('delUpload')}}",
					            	data:{oldImg:oldImg},
					            	success:function(data){

					            	}
					            });
					        })
					    });
					</script>
								</div>
							</div>
							<input type="submit" value="保存" class="save"style="margin-left: 300px;"/>
							<a href="javascript:void(0);" class="cancel2">取消</a>
					</div>
				</div>
			</div>

			<!-- <div class="item_container" id="company_comment">
				<div class="item_title">面试评价</div>
			</div> -->

		</div>
		<!--右边部分-->
		<div class="container_right">
			<div class="item_container">
				<div class="item_ltitle">公司基本信息</div>
				<span class="item_ropera2">
					<em></em>
					<span class="item_ropetext">编辑</span>

				</span>
				<!--展示模式-->
				<div class="item_content">
					<ul>
						<li>
							<i class="type"></i>
							<span>{{$data['industry']}}</span>
						</li>
						<li>
							<i class="process"></i>
							<span>{{$data['financing']}}</span>
						</li>
						<li>
							<i class="number"></i>
							<span>{{$data['size']}}</span>
						</li>
						<li>
							<i class="address"></i>
							<span>{{$data['address']}}</span>
						</li>
					</ul>
				</div>
				<!--编辑模式-->
				<div class="item_content_edit_wrap" style="display: none;">
					<div class="item_content_edit">

							<label>
								<select name="industry">
									<option value="{{$data['industry']}}" selected="selected">{{$data['industry']}}</option>
									<option value="移动互联网">移动互联网</option>
									<option value="电子商务">电子商务</option>
									<option value="金融">金融</option>
									<option value="广告营销">广告营销</option>
									<option value="招聘">招聘</option>
									<option value="其他">其他</option>
								</select>
							</label>
							<label>
								<select name="financing">
									<option value="{{$data['financing']}}" selected="selected">{{$data['financing']}}</option>
									<option value="未融资">未融资</option>
									<option value="天使轮">天使轮</option>
									<option value="A轮">A轮</option>
									<option value="B轮">B轮</option>
									<option value="C轮">C轮</option>
									<option value="D轮及以上">D轮及以上</option>
									<option value="上市公司">上市公司</option>
									<option value="不需要融资">不需要融资</option>
								</select>
							</label>
							<label>
								<select name="size">
									<option value="{{$data['size']}}" selected="selected">{{$data['size']}}</option>
									<option value="少于15人">少于15人</option>
									<option value="15-50人">15-50人</option>
									<option value="50-150人">50-150人</option>
									<option value="150-500人">150-500人</option>
									<option value="500-2000人">500-2000人</option>
									<option value="2000人以上">2000人以上</option>
								</select>
							</label>
							<label>
								地址：<br />
								<input type="text" name="address" value="{{$data['address']}}" value="address" />
							</label>
							<input type="submit" value="保存" class="save" style="margin-left: 20px;"/>
							<a href="javascript:void(0);" class="cancel2">取消</a>

					</div>
				</div>
			</div>
		</div>
	</div>

	<!--主体部分结束-->


	<!--回到顶部-->
	<a href="javascript:void(0);" id="back"></a>
	<!--回到顶部结束-->
</form>

	{{include file="../Common/footer"}}






<script type="text/javascript">
	$("input[type=buttom]").click(function(){
		$("form[name=edit]").submit();
	})
</script>







	</body>
</html>

















